import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

const store = new Vuex.Store({
	state:{
		agreeInfo: {},
		address: '', // 地址
		longitude: 0.0, // 经度
		latitude: 0.0, // 纬度
		login: '', // 登录状态
		adoptList: [] ,// 首页领养列表
	},
	mutations:{
		// 签署协议信息
		setAgreeInfo (state, data) {
			state.agreeInfo = data
		},
		setAddress (state, data) {
			state.address = data
		},
		setLongitude (state, data) {
			state.longitude = data
		},
		setLatitude (state, data) {
			state.latitude = data
		},
		setLogin (state, data) {
			state.login = data
		},
		setAdoptList (state, data) {
			state.adoptList = data
		}
	},
	actions:{},
	getters:{
		getAgreeInfo: state => {
			return state.agreeInfo
		},
		getAddress: state => {
			return state.address
		},
		getLongitude: state => {
			return state.longitude
		},
		getLatitude: state => {
			return state.latitude
		},
		getLogin: state => {
			return state.login
		},
		getAdoptList: state => {
			return state.adoptList
		}
	}
	
})

export default store